// Tests isGameOver()

#include "dominion.h"
#include "dominion_helpers.h"
#include <string.h>
#include <stdio.h>
#include <assert.h>
#include "rngs.h"

// set NOISY_TEST to 0 to remove printfs from output
#define NOISY_TEST 1

// set BOUNDARY_TEST to 0 to exclude boundary test cases.
#define BOUNDARY_TEST 0

int getCost(int cardNumber);

int main(int argc, char *argv[]) {
    int i;
    int seed = 1000;
    int numPlayer = 2;
    int maxBonus = 10;
    int p, r, handCount;
    int bonus;
    int k[10] = {adventurer, council_room, feast, gardens, mine
        , remodel, smithy, village, baron, great_hall};
    struct gameState G;
    int maxHandCount = 5;

    
    // arrays of all coppers, silvers, and golds
    int coppers[MAX_HAND];
    int silvers[MAX_HAND];
    int golds[MAX_HAND];
    
    printf ("TESTING isGameOver():\n\n");
            
// Test for number of province card
#if (NOISY_TEST == 1)
			printf("Test if game is over with %d players.\n", numPlayer);
#endif
            memset(&G, 23, sizeof(struct gameState));   // clear the game state
            r = initializeGame(numPlayer, k, seed, &G); // initialize a new game
            G.handCount[p] = handCount;                 // set the number of cards on hand
            G.supplyCount[province] = 0;
            
#if (NOISY_TEST == 1)
            printf("There are %d province card left.\n", G.supplyCount[province]);
#endif
            assert(G.supplyCount[province] == 0);

// Test number of supply cards
#if (NOISY_TEST == 1)
			printf("Test if game is over with %d players.\n", numPlayer);
#endif
            memset(&G, 23, sizeof(struct gameState));   // clear the game state
            r = initializeGame(numPlayer, k, seed, &G); // initialize a new game
            G.handCount[p] = handCount;                 // set the number of cards on hand
            G.supplyCount[i] = 0;
            
#if (NOISY_TEST == 1)
            printf("There are %d supply card(s) left.\n", G.supplyCount[i]);
#endif
            assert(G.supplyCount[i] == 0);
            
    
    printf("All tests passed!\n");
    
    return 0;
}